<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
</head>
<body bgcolor="white">

This package provides for OkkamNGClient, the web-service client that provides access to the 
latest generation of OKKAM's search and matching functionality.  <br><br>


<h2>Usage of SearchNGClient</h2>

What you need to do are the following steps
<ol>
<li>Create an AnnotatedQuery object. The class {@link org.okkam.match.query.annotated.AnnotatedQuery} 
is a nested data structure containing the parameters (or key/value pairs) that 
you want to use to query OKKAM. 
An AnnotatedQuery is made up of instances of classes in the 
package <i>org.okkam.match.query.annotated.</i>. To use these classes, we provide 
you with a jar file named <pre>annotatedquery-X.Y.Z.jar</pre> in the OkkamNGClient 
distribution. It is extracted from the OkkamCoreNG project, and related javadocs can be 
found in that distribution.
</li>
<li>Create an instance of {@link org.okkam.client.wsclient.SearchNGClient}. </li>
<li>Call its doSearch() method, passing the AnnotatedQuery as a parameter. You 
will get back an object of type {@link org.okkam.core.api.data.OkkamURIResult}. Again, 
its documentation is contained in the OkkamCoreNG distribution.  </li>
</ol>

<p>

<h3>Example</h3>

The following example code is contained in <i>org.okkam.client.test.ClientTest</i>:<p>

  <style type="text/css">
    <!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
  </style>


<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = -->
<!-- =   Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard  markus@jave.de   = -->
<!-- =     Further information: http://www.java2html.de     = -->
<div align="left" class="java">
<table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
   <tr>
  <!-- start source code -->
   <td nowrap="nowrap" valign="top" align="left">
    <code>
<font color="#7f0055"><b>package&nbsp;</b></font><font color="#000000">org.okkam.client.test;</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff"></font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">java.rmi.RemoteException;</font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">javax.xml.bind.JAXBException;</font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">org.okkam.client.wsclient.SearchNGClient;</font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">org.okkam.core.api.data.*;</font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">org.okkam.core.match.query.annotated.*;</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff"></font><br />
<font color="#3f5fbf">/**</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*&nbsp;This&nbsp;test&nbsp;is&nbsp;an&nbsp;example&nbsp;of&nbsp;the&nbsp;functionality&nbsp;of&nbsp;this&nbsp;web&nbsp;service&nbsp;client.&nbsp;</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*&nbsp;Pretty&nbsp;easy&nbsp;and&nbsp;straighforward.</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font color="#7f9fbf">@author&nbsp;</font><font color="#3f5fbf">stoermer</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*/</font><br />
<font color="#7f0055"><b>public&nbsp;class&nbsp;</b></font><font color="#000000">ClientTest&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;static&nbsp;</b></font><font color="#7f0055"><b>void&nbsp;</b></font><font color="#000000">main</font><font color="#000000">(</font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">args</font><font color="#000000">)</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">OkkamURIResult&nbsp;res&nbsp;=&nbsp;</font><font color="#7f0055"><b>null</b></font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">SearchNGClient&nbsp;search&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">SearchNGClient</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">AnnotatedQuery&nbsp;query&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">AnnotatedQuery</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">Annotation&nbsp;a&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">Annotation</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">QueryToken&nbsp;t&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">QueryToken</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">t.setValue</font><font color="#000000">(</font><font color="#2a00ff">&#34;Stoermer&#34;</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">a.getToken</font><font color="#000000">()</font><font color="#000000">.add</font><font color="#000000">(</font><font color="#000000">t</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">query.setQueryAnnotation</font><font color="#000000">(</font><font color="#000000">a</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>try</b></font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">res&nbsp;=&nbsp;search.doSearch</font><font color="#000000">(</font><font color="#000000">query</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}&nbsp;&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>catch&nbsp;</b></font><font color="#000000">(</font><font color="#000000">RemoteException&nbsp;e</font><font color="#000000">)</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.println</font><font color="#000000">(</font><font color="#2a00ff">&#34;Remote&nbsp;Exception:&nbsp;&#34;&nbsp;</font><font color="#000000">+&nbsp;e.getMessage</font><font color="#000000">())</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">e.printStackTrace</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>catch&nbsp;</b></font><font color="#000000">(</font><font color="#000000">JAXBException&nbsp;e</font><font color="#000000">)</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.println</font><font color="#000000">(</font><font color="#2a00ff">&#34;JAXB&nbsp;Exception:&nbsp;&#34;&nbsp;</font><font color="#000000">+&nbsp;e.getMessage</font><font color="#000000">())</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">e.printStackTrace</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>if</b></font><font color="#000000">(</font><font color="#000000">res&nbsp;!=&nbsp;</font><font color="#7f0055"><b>null</b></font><font color="#000000">)</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.println</font><font color="#000000">(</font><font color="#2a00ff">&#34;Code:&nbsp;&#34;&nbsp;</font><font color="#000000">+&nbsp;res.getCode</font><font color="#000000">())</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.println</font><font color="#000000">(</font><font color="#2a00ff">&#34;Message:&nbsp;&#34;&nbsp;</font><font color="#000000">+&nbsp;res.getMessage</font><font color="#000000">())</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>if</b></font><font color="#000000">(</font><font color="#000000">res.getCode</font><font color="#000000">()&nbsp;</font><font color="#000000">==&nbsp;</font><font color="#990000">0</font><font color="#000000">)</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">String&nbsp;</font><font color="#000000">[]&nbsp;</font><font color="#000000">uris&nbsp;=&nbsp;res.getResult</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>for&nbsp;</b></font><font color="#000000">(</font><font color="#7f0055"><b>int&nbsp;</b></font><font color="#000000">i&nbsp;=&nbsp;</font><font color="#990000">0</font><font color="#000000">;&nbsp;i&nbsp;&lt;&nbsp;uris.length;&nbsp;++i</font><font color="#000000">)</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">System.out.println</font><font color="#000000">(</font><font color="#2a00ff">&#34;URI_&#34;</font><font color="#000000">+i+</font><font color="#2a00ff">&#34;:&nbsp;&#34;</font><font color="#000000">+uris</font><font color="#000000">[</font><font color="#000000">i</font><font color="#000000">])</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff"></font><br />
<font color="#000000">}</font></code>
    
   </td>
  <!-- end source code -->
   </tr>
</table>
</div>
<!-- =       END of automatically generated HTML code       = -->
<!-- ======================================================== -->

<h2>Usage of ProfileRetrieverClient</h2>

The ProfileRetriever returns an instance of EntityProfile (from okkam-entityprofile-x.y.z.jar, project OkkamCoreNG) for 
an OKKAM URI that you supply. The javadoc of EntityProfile is in OkkamCoreNG-x.y.z.zip.

<h3>Example</h3>
<p>
  <style type="text/css">
    <!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
  </style>

<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = -->
<!-- =   Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard  markus@jave.de   = -->
<!-- =     Further information: http://www.java2html.de     = -->
<div align="left" class="java">
<table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">
   <tr>
  <!-- start source code -->
   <td nowrap="nowrap" valign="top" align="left">
    <code>
<font color="#3f5fbf">/**</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*/</font><br />
<font color="#7f0055"><b>package&nbsp;</b></font><font color="#000000">org.okkam.client.test;</font><br />
<font color="#ffffff"></font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">java.rmi.RemoteException;</font><br />
<font color="#ffffff"></font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">javax.xml.bind.JAXBException;</font><br />
<font color="#ffffff"></font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">org.okkam.client.wsclient.ProfileRetrieverClient;</font><br />
<font color="#7f0055"><b>import&nbsp;</b></font><font color="#000000">org.okkam.core.api.data.entityprofile.EntityProfile;</font><br />
<font color="#3f5fbf">/**</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font color="#7f9fbf">@author&nbsp;</font><font color="#3f5fbf">stoermer</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*</font><br />
<font color="#ffffff">&nbsp;</font><font color="#3f5fbf">*/</font><br />
<font color="#7f0055"><b>public&nbsp;class&nbsp;</b></font><font color="#000000">ProfileRetrieverTest&nbsp;</font><font color="#000000">{</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#3f5fbf">/**</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*&nbsp;</font><font color="#7f9fbf">@param&nbsp;</font><font color="#3f5fbf">args</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;</font><font color="#3f5fbf">*/</font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#7f0055"><b>public&nbsp;static&nbsp;</b></font><font color="#7f0055"><b>void&nbsp;</b></font><font color="#000000">main</font><font color="#000000">(</font><font color="#000000">String</font><font color="#000000">[]&nbsp;</font><font color="#000000">args</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">ProfileRetrieverClient&nbsp;prc&nbsp;=&nbsp;</font><font color="#7f0055"><b>new&nbsp;</b></font><font color="#000000">ProfileRetrieverClient</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#7f0055"><b>try&nbsp;</b></font><font color="#000000">{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">EntityProfile&nbsp;pro&nbsp;=&nbsp;prc.getProfile</font><font color="#000000">(</font><font color="#2a00ff">&#34;http://www.okkam.org/entity/43da58d8-2fcf-4a7d-aba0-417a22a8c562&#34;</font><font color="#000000">)</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}&nbsp;</font><font color="#7f0055"><b>catch&nbsp;</b></font><font color="#000000">(</font><font color="#000000">RemoteException&nbsp;e</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#3f7f5f">//&nbsp;TODO&nbsp;Auto-generated&nbsp;catch&nbsp;block</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">e.printStackTrace</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}&nbsp;</font><font color="#7f0055"><b>catch&nbsp;</b></font><font color="#000000">(</font><font color="#000000">JAXBException&nbsp;e</font><font color="#000000">)&nbsp;{</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#3f7f5f">//&nbsp;TODO&nbsp;Auto-generated&nbsp;catch&nbsp;block</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">e.printStackTrace</font><font color="#000000">()</font><font color="#000000">;</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff">&nbsp;&nbsp;&nbsp;&nbsp;</font><br />
<font color="#ffffff"></font><br />
<font color="#ffffff">&nbsp;&nbsp;</font><font color="#000000">}</font><br />
<font color="#ffffff"></font><br />
<font color="#000000">}</font></code>
    
   </td>
  <!-- end source code -->
   </tr>
</table>
</div>
<!-- =       END of automatically generated HTML code       = -->
<!-- ======================================================== -->

<p>

<h2>Usage of EntityProfilePublicationClient</h2>

Profile publication requires an instance of {@link EntityProfile} to be passed as a parameter. 
The method returns a string containing the OKKAM ID that has been created, or null/empty string if creation has failed. (This should be improved).

<h2>Related Documentation</h2>

The OkkamCoreNG API Doc.

</body>
</html>